import { ObjCreate } from "../common/ObjCreate";
import { GTextFormat } from "../../../common/GTextFormat";
import { FontUtil } from "../../../common/font/FontUtil";
import { GlobalStyle } from "../../../common/global/GlobalStyle";
import { GlobalClass } from "../../../../com/mui/core/GlobalClass";
import { ImagesConst } from "../../resource/ImagesConst";
import { GCheckBox } from "../../../../com/mui/controls/GCheckBox";
import { GTextFiled } from "../../../../com/mui/controls/GTextFiled";
//class AnswerItem
    
    export  class AnswerItem /* flash.display.Sprite */
    {
        constructor()
        {
            
            this._cb = ObjCreate.createCheckBox("", 0, 0, 300, 28, this);
            this._label = ObjCreate.createGTextField("", 22, 4, 240, 40, this, new GTextFormat(FontUtil.songtiName, 12, GlobalStyle.color1Uint, null, null, null, null, null, flash.text.TextFormatAlign.LEFT, null, null, null, 2));
            this._label.wordWrap = true;
            this._label.multiline = true;
            this._label.mouseWheelEnabled = false;
            this._rightTip = ObjCreate.createBitmap(null, 5, 0, this);
            this._rightTip.visible = false;
            return;
        }

        public set selected(arg1: Boolean)
        {
            this._cb.selected = arg1;
            return;
        }

        public get selected(): Boolean
        {
            return this._cb.selected;
        }

        public set selectEnabled(arg1: Boolean)
        {
            this._cb.enabled = arg1;
            return;
        }

        public set label(arg1: string)
        {
            this._labelText = arg1;
            this._label.htmlText = arg1;
            return;
        }

        public get label(): string
        {
            return this._labelText;
        }

        public set showTips(arg1: Boolean)
        {
            this._rightTip.visible = arg1;
            this._rightTip.x = this._label.x + this._label.textWidth + 10;
            return;
        }

        public clear(): void
        {
            this._label.htmlText = "";
            this._cb.selected = false;
            this._cb.enabled = true;
            this._rightTip.visible = false;
            return;
        }

        public updateRes(): void
        {
            this._rightTip.bitmapData = GlobalClass.getBitmapData(ImagesConst.qB_right);
            return;
        }

        /* internal */ /* var */_cb: GCheckBox;

        /* internal */ /* var */_label: GTextFiled;

        /* internal */ /* var */_rightTip: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_labelText: string;
    }
